﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Data;
using PictureControls;
using MySqlConnection;
using UserControls.Popups;
using Framework;

namespace Pages
{
    public partial class Customize : ContextPage
    {
        protected void Page_Init(object sender, EventArgs e)
        {
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            SelectMenuItem(UserControls.Menu.Menu.ElementsMenu.Customize);
            displayAllImages();
        }


        private void displayAllImages()
        {
            List<VOImage> AllImages = ImageData.GetAllImages2();
            Session[SessionConstants.SessionListImages] = AllImages;
            int i = 0;
            if (AllImages.Count > 0)
            {
                foreach (VOImage img in AllImages)
                {
                    if (i%5 == 0)
                    {
                        pnlAllImages.Controls.Add(new LiteralControl("<div style='clear:both'></div>"));
                    }
                    DisplayPicture dd = new DisplayPicture();
                    dd.Title = img.Title;
                    dd.Description = img.Description;
                    dd.PictureId = img.Id;
                    pnlAllImages.Controls.Add(dd);
                    i++;
                }
            }
        }
    }
}